import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      redirect: '/main',
      children: [
        {
          path: '/main',
          name: 'main',

          component: () => import('../views/mainView.vue')
        },
        {
          path: '/list',
          name: 'list',

          component: () => import('../views/listView.vue')
        },
        {
          path: '/add',
          name: 'add',

          component: () => import('../views/addView.vue')
        },
        {
          path: '/set',
          name: 'set',

          component: () => import('../views/setView.vue')
        },
        {
          path: '/user',
          name: 'user',

          component: () => import('../views/userView.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',

      component: () => import('../views/loginView.vue')
    }
  ]
})

export default router
